/*
 ============================================================================
 Name		: symcontrolAppView.cpp
 Author	  : Vanderson Rodrigues
 Copyright   : Your copyright notice
 Description : Application view implementation
 ============================================================================
 */

// INCLUDE FILES
#include <coemain.h>
#include "symcontrolAppView.h"

// ============================ MEMBER FUNCTIONS ===============================

// -----------------------------------------------------------------------------
// CsymcontrolAppView::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CsymcontrolAppView* CsymcontrolAppView::NewL(const TRect& aRect)
    {
    CsymcontrolAppView* self = CsymcontrolAppView::NewLC(aRect);
    CleanupStack::Pop(self);
    return self;
    }

// -----------------------------------------------------------------------------
// CsymcontrolAppView::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CsymcontrolAppView* CsymcontrolAppView::NewLC(const TRect& aRect)
    {
    CsymcontrolAppView* self = new (ELeave) CsymcontrolAppView;
    CleanupStack::PushL(self);
    self->ConstructL(aRect);
    return self;
    }

// -----------------------------------------------------------------------------
// CsymcontrolAppView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CsymcontrolAppView::ConstructL(const TRect& aRect)
    {
    // Create a window for this application view
    CreateWindowL();

    // Set the windows size
    SetRect(aRect);

    // Activate the window, which makes it ready to be drawn
    ActivateL();
    }

// -----------------------------------------------------------------------------
// CsymcontrolAppView::CsymcontrolAppView()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CsymcontrolAppView::CsymcontrolAppView()
    {
    // No implementation required
    }

// -----------------------------------------------------------------------------
// CsymcontrolAppView::~CsymcontrolAppView()
// Destructor.
// -----------------------------------------------------------------------------
//
CsymcontrolAppView::~CsymcontrolAppView()
    {
    // No implementation required
    }

// -----------------------------------------------------------------------------
// CsymcontrolAppView::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CsymcontrolAppView::Draw(const TRect& /*aRect*/) const
    {
    // Get the standard graphics context
    CWindowGc& gc = SystemGc();

    // Gets the control's extent
    TRect drawRect(Rect());

    // Clears the screen
    gc.Clear(drawRect);

    }

// -----------------------------------------------------------------------------
// CsymcontrolAppView::SizeChanged()
// Called by framework when the view size is changed.
// -----------------------------------------------------------------------------
//
void CsymcontrolAppView::SizeChanged()
    {
    DrawNow();
    }

// -----------------------------------------------------------------------------
// CsymcontrolAppView::HandlePointerEventL()
// Called by framework to handle pointer touch events.
// Note: although this method is compatible with earlier SDKs, 
// it will not be called in SDKs without Touch support.
// -----------------------------------------------------------------------------
//
void CsymcontrolAppView::HandlePointerEventL(
        const TPointerEvent& aPointerEvent)
    {

    // Call base class HandlePointerEventL()
    CCoeControl::HandlePointerEventL(aPointerEvent);
    }

// End of File
